#ifndef frametimer_h__
#define frametimer_h__

namespace gecko
{

// measures frame time for applying DTs
class FrameTimer
{
public:
	// constructor
	FrameTimer();

	// start the frame timer
	void Start();

	// tick at the end of the frame
	void Frame();

	// get the framerate
	float GetFramesPerSec();

	// get the frame time in seconds
	float GetSecsPerFrame();

private:
	__int64 GetTicks();
	__int64 GetTicksPerSec();
	__int64 GetTicksPerFrame();

	float m_ticksPerSec;
	float m_framesPerSec;
	float m_secsPerFrame;
	__int64 m_qwTicks;
	__int64 m_qwTicksPerSec;
	__int64 m_qwTicksPerFrame;
};

inline float FrameTimer::GetFramesPerSec()
{
	return m_framesPerSec;
}

inline __int64 FrameTimer::GetTicksPerSec()
{
	return m_qwTicksPerSec;
}

inline __int64 FrameTimer::GetTicksPerFrame()
{
	return m_qwTicksPerFrame;
}

inline float FrameTimer::GetSecsPerFrame()
{
	return m_secsPerFrame;
}

}

#endif
